<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="../WEB-INF/template_admin.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateEmpleadoTitle}"></h:outputText>
        </ui:define>
        <ui:define name="content">

            <div class="content">
                <br />
                <ul class="lista-mapa-sitio">
                    <li><a href="#{request.contextPath}/faces/administrador.xhtml">Administrar</a> / </li>
                    <li><a href="#{request.contextPath}/faces/empleado/ListaEmpleado.xhtml">Empleados</a> / </li>
                    <li>Agregar nuevo empleado</li>
                </ul>
                <p:panel header="Crear Empleado" styleClass="panel-usuario" style="width: 600px">

                    <p:growl id="growl" />
                    <h:panelGroup id="messagePanel" layout="block">
                        <p:messages autoUpdate="true"/>
                    </h:panelGroup>
                    <h:form>
                        <h:panelGrid columns="2">
                            <h:outputLabel value="Nombres de Empleado:" for="empPersonaId" />
                            <p:selectOneMenu id="empPersonaId" value="#{empleadoController.selected.empPersonaId}" title="#{bundle.CreateEmpleadoTitle_empPersonaId}" required="true" requiredMessage="#{bundle.CreateEmpleadoRequiredMessage_empPersonaId}">
                                <f:selectItems value="#{personaController.itemsAvailableSelectOne}"/>
                            </p:selectOneMenu>
                            <h:outputLabel value="#{bundle.CreateEmpleadoLabel_empSueldo}" for="empSueldo" />
                            <p:inputText id="empSueldo" value="#{empleadoController.selected.empSueldo}" title="#{bundle.CreateEmpleadoTitle_empSueldo}" required="true" requiredMessage="#{bundle.CreateEmpleadoRequiredMessage_empSueldo}">
                                <f:validateDoubleRange minimum="200" maximum="2000"/>
                            </p:inputText>
                            <h:outputLabel value="#{bundle.CreateEmpleadoLabel_empFechaIngreso}" for="empFechaIngreso" />
                            <p:calendar id="empFechaIngreso" pattern="dd/MM/yyyy" value="#{empleadoController.selected.empFechaIngreso}" title="#{bundle.CreateEmpleadoTitle_empFechaIngreso}" required="true" requiredMessage="#{bundle.CreateEmpleadoRequiredMessage_empFechaIngreso}" locale="es" effect="fadeIn" navigator="true" />
                            <h:outputLabel value="#{bundle.CreateEmpleadoLabel_empPaisId}" for="empPaisId" />
                            <p:selectOneMenu id="empPaisId" value="#{empleadoController.selected.empPaisId}" title="#{bundle.CreateEmpleadoTitle_empPaisId}" required="true" requiredMessage="#{bundle.CreateEmpleadoRequiredMessage_empPaisId}">
                                <f:selectItems value="#{catPaisController.itemsAvailableSelectOne}"/>
                            </p:selectOneMenu>
                            <h:outputLabel value="#{bundle.CreateEmpleadoLabel_empSucursalId}" for="empSucursalId" />
                            <p:selectOneMenu id="empSucursalId" value="#{empleadoController.selected.empSucursalId}" title="#{bundle.CreateEmpleadoTitle_empSucursalId}" required="true" requiredMessage="#{bundle.CreateEmpleadoRequiredMessage_empSucursalId}">
                                <f:selectItems value="#{sucursalController.itemsAvailableSelectOne}"/>
                            </p:selectOneMenu>
                        </h:panelGrid>
                        <br />
                        <p:commandLink actionListener="#{empleadoController.create}" value="#{bundle.CreateEmpleadoSaveLink}" update=":growl" />
                        <br />
                        <br />
                        <h:commandLink class="jsfcrud_commandlinks_action" action="#{empleadoController.prepareList}" value="#{bundle.CreateEmpleadoShowAllLink}" immediate="true"/>
                        <br />
                        <br />
                    </h:form>
                </p:panel>
            </div><!-- end of content -->
        </ui:define>
    </ui:composition>

</html>
